# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-plette
pkgver=0.4.4
pkgrel=2
pkgdesc="Structured Pipfile and Pipfile.lock models"
url="https://github.com/sarugaku/plette"
license=('ISC')
arch=('any')
depends=('python-tomlkit')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest' 'python-cerberus')
source=("$pkgname-$pkgver.tar.gz::https://github.com/sarugaku/plette/archive/v$pkgver.tar.gz")
sha512sums=('c4342ce040966730d2eba638c718c1db9340051baa89238b99e64cf8ef734fe448f0aaeae224e9f6b51c9e38458e9caeb2c8d6abbd5db76249529aaee90ed5c0')

build() {
  cd plette-$pkgver
  python -m build -nw
}

check() {
  cd plette-$pkgver
  PYTHONPATH="$PWD/build/lib" pytest
}

package() {
  cd plette-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
